<?php
include 'functions.php';
$db = include 'db.php';

//获得key参数
$key = $_GET['key'];
//获得db数组中key号数据
$msgdb = $db[$key];
p($msgdb);

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>HouDun许愿墙</title>
    <link rel="stylesheet" href="../Css/index.css"/>
    <script type="text/javascript" src='../Js/jquery-1.7.2.min.js'></script>
    <script type="text/javascript" src='../Js/index.js'></script>
</head>
<body>
<div id='top'>
    <span id='send'></span>
</div>
<div id='main'>


</div>

<div id='send-form' style="display: block;position: fixed;left: 50%;top:50%;transform: translate(-50%,-50%);">
    <p class='title'><span>许下你的愿望</span><a href="" id='close'></a></p>


    <form action="doedit.php" name='wish'>
        <p>
            <label for="username">昵称：</label>
            <input type="text" name='username' id='username' value="<?php echo $msgdb['name'] ?>"/>
        </p>
        <p>
            <label for="content">愿望：(您还可以输入&nbsp;<span id='font-num'>50</span>&nbsp;个字)</label>
            <textarea name="content" id='content'><?php echo $msgdb['content'] ?></textarea>

        </p>

        <input type="hidden" name="key" value="<?php echo $key ?>">
        
        <input id='send-btn' type="submit" value="">
    </form>


</div>
<!--[if IE 6]>
<script type="text/javascript" src="../Js/iepng.js"></script>
<script type="text/javascript">
    DD_belatedPNG.fix('#send,#close,.close', 'background');
</script>
<![endif]-->
</body>
</html>